package com.wxit.threadlocal.object;

/**
 * 对象深入，构造方法
 */
public class Demo {
    public static void main(String[] args) {
        //分配内存空间
        //调用构造方法
        B b = new B();
    }
}

class A {
    int a ;
    //三件事
    public A() {
        super();
        a = 10;
        print();
    }

    public void print() {
        System.out.println(a);
    }
}

class B extends A {
    int b;
    public B() {
        super();
        b = 20;
        print();
    }

    public void print(){
        System.out.println(super.a);
        System.out.println(this.b);
    }
}
